package com.chengww.grab_rp.activities

import android.app.Activity
import android.content.Intent
import android.view.MenuItem
import com.chengww.grab_rp.R
import com.chengww.grab_rp.base.BaseActivity
import com.chengww.grab_rp.base.BaseViewModel
import com.chengww.grab_rp.base.EmptyViewModel
import com.chengww.grab_rp.databinding.ActivityHelpBinding

/**
 * Created by chengww on 2/22/21
 * @author chengww
 */
class HelpActivity: BaseActivity<BaseViewModel, ActivityHelpBinding>() {
    override fun layoutId() = R.layout.activity_help

    override fun provideVM() = EmptyViewModel

    override fun initView() {
        supportActionBar?.setDisplayShowHomeEnabled(true)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
        supportActionBar?.setTitle(R.string.title_help)
    }

    companion object {
        fun newIntent(activity: Activity) {
            val intent = Intent(activity, HelpActivity::class.java)
            activity.startActivity(intent)
        }
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        when (item.itemId) {
            android.R.id.home -> finish()
        }
        return super.onOptionsItemSelected(item)
    }
}